package com.kmxd.ams.infra.system.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 报表管理
 *
 * @author ZuoLG
 * @since 2022-09-21
 */
@Data
@TableName("sys_ureport")
@Schema(description = "报表管理对象")
public class SysUreport implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "主键ID")
  private Long id;

  /** 公司ID */
  @Schema(description = "公司ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "公司ID")
  private Long comId;

  /** 全宗ID */
  @Schema(description = "全宗ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "全宗ID")
  private Long fondsId;

  @Schema(description = "名称 非空")
  @ExcelProperty(value = "名称 非空")
  private String name;

  @Schema(description = "内容")
  @ExcelProperty(value = "内容")
  private byte[] content;

  @Schema(description = "关联ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "关联ID")
  private Long refId;

  /** 适用档案范围: 1项目, 2案卷, 3文件. 4盒 */
  @Schema(description = "表名")
  private String tableId;

  @Schema(description = "别名")
  @ExcelProperty(value = "别名")
  private String aliasName;

  @Schema(description = "备注")
  @ExcelProperty(value = "备注")
  private String remarks;

  @Schema(description = "排序")
  @ExcelProperty(value = "排序")
  private Integer sort;

  @Schema(description = "创建人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "创建人")
  @TableField(fill = FieldFill.INSERT)
  private Long createBy;

  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "创建时间")
  @TableField(fill = FieldFill.INSERT)
  private Date createTime;

  @Schema(description = "更新人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "更新人")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Long updateBy;

  @Schema(description = "更新时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "更新时间")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Date updateTime;
}
